﻿create PROCEDURE Sync.SP_Villages_SelectChanges
@LastRowVersion rowversion,
@FilterdColumn UNIQUEIDENTIFIER
AS 
BEGIN 
	SELECT 
        t.[VillageID],
		g.[VillageName],g.[CenterID],
		t.IsDeleted,
		t.LastUpdatedDate
	FROM [dbo].[Villages] g RIGHT JOIN Sync.Villages_Tracking t  
    ON t.VillageID = g.VillageID 
	WHERE @LastRowVersion IS NULL OR t.Version > @LastRowVersion
    END





